package com.pzhu.record.entity;

import java.io.Serializable;
import java.util.List;

/**
 * 分页、搜索类
 */
public class Page<T> implements Serializable {
    private int pageNumber;//总记录数
    private int pageCount;//总页数
    private int pageIndex;//当前页
    private String keywords; //关键字
    private T paramEntity; //泛型类
    private int pageSize = 5;//每页大小
    private List<T> list;//当前页的数据

    private int start; //开始条数

    public Page() {
    }

    public T getParamEntity() {
        return paramEntity;
    }

    public void setParamEntity(T paramEntity) {
        this.paramEntity = paramEntity;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public int getStart() {
        this.start = (pageIndex - 1) * pageSize;
        return start;
    }

    public void setStart(int start) {

        this.start = start;
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "Page{" +
                "pageNumber=" + pageNumber +
                ", pageCount=" + pageCount +
                ", pageIndex=" + pageIndex +
                ", keywords='" + keywords + '\'' +
                ", pageSize=" + pageSize +
                ", list=" + list +
                ", start=" + start +
                '}';
    }
}
